#-*-coding:utf-8-*-
class HA_Decorator(object):
    def __init__(self,parm):
        super(HA_Decorator,self).__init__()
        self.parm=parm

    def selectCurrentNode(self,node):
        #node.setSelected(1,1,1)
        print('selectCurrentNode')


    def showNodeTypeName(self,node):
        #print node.type().name()
        print('showNodeTypeName')
    def __call__(self, func): # 接受函数
        def wrapper(*args, **kwargs):
            node= func(*args, **kwargs)
            if self.parm=='selected':
                self.selectCurrentNode(node)

            elif self.parm=='type':
                self.showNodeTypeName(node)
        return wrapper  #返回函数